<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript">
			function fun(){
				var name = prompt("请输入学号","20210001");
				if(name != null && name != ""){
					document.write("您好："+name);
				}else if(name == null){
					alert("您点击了取消按钮！");
				}else{
					alert("您输入了空的学号！");
				}
			}
		</script>
	</head>
	<body>
		<form method="post" action="">
			<input type="button" onclick="fun()" value="显示提示框" />
		</form>
	</body>
</html>
